package com.xinlianshiye.im.controller;

import com.xinlianshiye.im.bean.User;
import com.xinlianshiye.im.response.ImageView;
import com.xinlianshiye.im.utils.ImageUpload;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@Slf4j
@RestController
public class IMUploadController {

    @PostMapping("/im/upload")
    public ImageView upload(MultipartFile file) throws IOException {
        return ImageUpload.upload(User.class, file);
    }
}
